package com.huang.LockSupport;

import java.util.concurrent.TimeUnit;


public class test {
    public static void main(String[] args) throws InterruptedException {
        Object o = new Object();


        new Thread(()->{
            synchronized (o){
                System.out.println("n前");

                o.notify();


                System.out.println("n后");
            }


        }).start();

        TimeUnit.SECONDS.sleep(2);
        new Thread(()->{
        synchronized (o){
            try {
                System.out.println("w前");
                o.wait();
                System.out.println("w后");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
          }).start();




    }
}
